package com.prasad.java;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.junit.Assert;
import org.junit.Test;

public class ComparatorComparable {

	public static void main(String[] args) {

		ArrayList<String> list1 = new ArrayList<String>();
		list1.add("a");
		list1.add("A");
		list1.add("B");
		list1.add(new String("2"));
		
		System.out.println(list1);
		Collections.sort(list1);
		System.out.println(list1);
		Collections.sort(list1,new StringCompare());
		System.out.println(list1);
		
		
		Person p1 = new Person("A","F");
		Person p2 = new Person("B","M");
		
		int res = p1.compareTo(p2);
		
		System.out.println(res);
		
		
	}
	
	@Test
	public void testPerson() {
		
		List<String> list = new ArrayList<String>();
		
		list.add("B");
		list.add("A");
	}
	
	
	
	
}
